
def parse_args_wrapper(fn):
    def wrapper(*args, **kwargs):
        args_result = fn(*args, **kwargs)
        if args_result.cli_arg_yaml_cfgs is not None:
            import yaml
            assert args_result.yaml_cfg is None, 'cli arg yaml config is not compatible with `args.yaml_cfg`'

            tmp_args = {}
            for cfg_path in args_result.cli_arg_yaml_cfgs:
                with open(cfg_path, "r") as in_f:
                    part_arg = yaml.load(in_f, Loader=yaml.FullLoader)
                tmp_args.update(part_arg)
            for arg_k, arg_v in tmp_args.items():
                setattr(args_result, arg_k, arg_v)
        return args_result
    return wrapper
